<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>CorpInfo</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <!-- Le styles -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap-responsive.css" rel="stylesheet">
    <link href="js/bootstrap.js" rel="stylesheet">
    <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<body>

<?php
include("/usr/local/apache2/htdocs/jibaiwang/lib/CorpInfo.php");
include('log4php/Logger.php');
$cfgfile = "/usr/local/apache2/htdocs/jibaiwang/admin/bootstrap/conf/config.ini";
$defarray = parse_ini_file($cfgfile, 1);
$qlogtag = $defarray["CorpInfo"]['qlogtag'];
Logger::configure($defarray["CorpInfo"]['qlogcfg']);
$logger = Logger::getLogger($qlogtag);
$host = $defarray["CorpInfo"]["host"];
$user = $defarray["CorpInfo"]["user"];
$pass = $defarray["CorpInfo"]["pass"];
$db = $defarray["CorpInfo"]["db"];
$dbh = new Sqlexecutor($host, $user, $pass, $db);
$s = new CorpInfo($dbh,$logger);
if($_REQUEST["submit"] == "1")
{
    $subject1 = $_REQUEST["subject1"];
    $subject2 = $_REQUEST["subject2"];
    $subject3 = $_REQUEST["subject3"];
    $subject4 = $_REQUEST["subject4"];
    $subject5 = $_REQUEST["subject5"];
    $subject6 = $_REQUEST["subject6"];
    $subject7 = $_REQUEST["subject7"];
    $res = $s->update($subject1, $subject2, $subject3,$subject4,$subject5,$subject6,$subject7);
}
$list = $s->getInfo();
$txt1 = $list["txt1"];
$txt2 = $list["txt2"];
$txt3 = $list["txt3"];
$txt4 = $list["txt4"];
$txt5 = $list["txt5"];
$txt6 = $list["txt6"];
$txt7 = $list["txt7"];
?>

  <form class="form-horizontal" target="_self">
    <fieldset>
      <legend>添加公司信息</legend>
      <div class="control-group">
            <div class="controls">
                <input type="text" name="subject1" id="subject1" class="span5" placeholder="佛山吉百旺陶瓷公司" value="<?php echo $txt1;?>">
            </div>
      </div>
      <div class="control-group">
            <div class="controls">
                <input type="text" name="subject2" id="subject2" class="span5" placeholder="地址：广东省佛山市禅城" value="<?php echo $txt2;?>">
            </div>
      </div>
      <div class="control-group">
              <div class="controls">
                  <input type="text" name="subject3" id="subject3" class="span5" placeholder="产地：三龙工业园" value="<?php echo $txt3;?>">
              </div>
      </div>
      <div class="control-group">
              <div class="controls">
                  <input type="text" name="subject4" id="subject4" class="span5" placeholder="客服电话：400 116 8862" value="<?php echo $txt4;?>">
              </div>
      </div>
      <div class="control-group">
              <div class="controls">
                  <input type="text" name="subject5" id="subject5" class="span5" placeholder="华东联系人：河海" value="<?php echo $txt5;?>">
              </div>
      </div>
      <div class="control-group">
              <div class="controls">
                  <input type="text" name="subject6" id="subject6" class="span5" placeholder="联系电话：1381187" value="<?php echo $txt6;?>">
              </div>
      </div>
      <div class="control-group">
              <div class="controls">
                  <input type="text" name="subject7" id="subject7" class="span5" placeholder="传真：111111" value="<?php echo $txt7;?>">
              </div>
      </div>
    </fieldset>
             <button style="right:500px margin-top:10px; margin-left:50px; margin-left:10px; margin-bottom:10px;"value="1" type="submit" name="submit" class="btn btn-warning btn-large" >提交</button>
  </form>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster
    <script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script> -->
    <script src="js/jquery.js"></script>
    <script src="js/google-code-prettify/prettify.js"></script>
    <script src="js/bootstrap-transition.js"></script>
    <script src="js/bootstrap-alert.js"></script>
    <script src="js/bootstrap-modal.js"></script>
    <script src="js/bootstrap-dropdown.js"></script>
    <script src="js/bootstrap-scrollspy.js"></script>
    <script src="js/bootstrap-tab.js"></script>
    <script src="js/bootstrap-tooltip.js"></script>
    <script src="js/bootstrap-popover.js"></script>
    <script src="js/bootstrap-button.js"></script>
    <script src="js/bootstrap-collapse.js"></script>
    <script src="js/bootstrap-carousel.js"></script>
    <script src="js/bootstrap-typeahead.js"></script>
    <script src="js/application.js"></script>
    <script src="js/customize.js"></script>

<script>
$('.carousel').carousel({
    interval: 12000
})
</script>

</body>
</html>
